package com.cxl.controller;

import com.cxl.config.AjaxResult;
import com.cxl.springboot.starter.message.ShortMessageResult;
import com.cxl.springboot.starter.message.ShortMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 20971
 * @time: 2022/2/17 16:32
 * @description:
 */
@RestController
@RequestMapping(value = "/message")
public class ShortMessageController {

    @Autowired
    private ShortMessageService shortMessageService;

    @PostMapping(value = "shortmessage")
    public AjaxResult shortmessage(String number,String code) throws Exception {
        System.out.println("验证码==================="+code);
        ShortMessageResult shortMessageResult = shortMessageService.sendOnePlaceholder(number, "8148", code);
        return AjaxResult.ok(shortMessageResult);
    }
}
